package com.xca.znb.presenter;

import com.xca.znb.entity.Goods;
import com.xca.znb.entity.Order;
import com.xca.znb.model.imodel.IOrders;

import java.util.List;

public class OrdersPresenter {
    private IOrders iOrders ;
    public OrdersPresenter(IOrders iOrders){
        this.iOrders = iOrders ;
    }

    public List<Order> getAllOrderBuy(String phone) {
        return iOrders.getAllOrderBuy(phone);
    }
    public List<Order> getOrderBuy(String phone, String type) {
        return iOrders.getOrderBuy(phone, type);
    }

    public List<Order> getAllOrderSale(String phone) {
        return iOrders.getAllOrderSales(phone);
    }

    public List<Order> getOrderSales(String phone, String type) {
        return iOrders.getOrderSales(phone, type);
    }

    public void updateOrderType(int id, String type , String time) {
        iOrders.updateOrderType(id, type , time);
    }

    public Goods getGoodsById(int id){
        return iOrders.getGoodsById(id);
    }

    public void  insertAccount(String phone , double num , String type , String time_day , String time_sec){
        iOrders.insertAccount(phone, num, type, time_day, time_sec);
    }
    public Order getOrderById(int id){
        return iOrders.getOrderById(id);
    }
}
